﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class MessageBoxDelegateCtrl : MonoBehaviour {

	public UILabel m_kLabel;
	public GameObject m_kOKBtn;
	public UILabel m_kBtnLabel;
	
	private ClickListener click;

    public List<UITweener> tweeners;
	
	void OnEnable ()
	{
        m_kBtnLabel.text = LanguageTool.GetTextNoUpdate(1036);
	}
	
	public void Init (string sLabel, ClickListener kClickBtn)
	{
		m_kLabel.text = sLabel;
		click = kClickBtn;
        foreach (var tweener in tweeners) {
            tweener.ResetToBeginning();
            tweener.PlayForward();
        }
	}
	
	public void Click ()
	{
		click();
        Destroy(gameObject);
	}

    public void Closed()
    {
        Destroy(gameObject);
    }
	
	public delegate void ClickListener();
}
